package com.tionsy.springbootcomponents.common.login.bean;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <p></p>
 * <p>
 * <PRE>
 * <BR>    修改记录
 * <BR>-----------------------------------------------
 * <BR>    修改日期         修改人          修改内容
 * </PRE>
 *
 * @author tiany
 * @version 1.0
 * @date Created in 2021年02月07日 16:21
 * @since 1.0
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class ContextLog {
    private String traceId;

    private long millisecond;

    public static final ThreadLocal<ContextLog> local = new ThreadLocal<>();

    public static void set(ContextLog contextLog){
        local.set(contextLog);
    }

    public static ContextLog get(){
        return local.get();
    }

    public static void  clear(){
        local.remove();
    }
}
